import routerNames from '@/router/routerNames'
import Main from '@/views/Main'
import MenuTableData from '@/views/menu/MenuTableData'
import CommonTableInfo from '@/views/CommonTableInfo'
import ModelTree from '@/views/model/ModelTree'
import ModelInfoOption from '@/views/model/ModelInfoOption'
import ModelLabelInfo from '@/views/model/ModelLabelInfo'
import RefreshPage from '@/components/common/RefreshPage'
import ModelDefinitionInfo from '@/views/model/ModelDefinitionInfo'
import ModelLabelTableData from '@/views/model/ModelLabelTableData'
import ModelDefinitionTableData from '@/views/model/ModelDefinitionTableData'
import ModelAttributeTableData from '@/views/model/ModelAttributeTableData'
import ModelFormConfigTableData from '@/views/model/ModelFormConfigTableData'
import DraggableExample from '@/views/DraggableExample'

const routerPath = [
  {
    path: '/',
    component: Main,
    redirect: '/menu/setting',
    name: routerNames.main,
    children: [
      {name: routerNames.refresh, path: 'refresh', component: RefreshPage},
      {path: 'menu/setting', component: MenuTableData},
      {path: 'tableInfo2', component: CommonTableInfo},
      {path: 'draggable', component: DraggableExample},
      {
        name: routerNames.modelMainConfig,
        path: 'modelConfig',
        component: ModelTree,
        children: [
          {path: 'config/:id', component: ModelInfoOption, name: 'config'},
          {
            path: 'labelInfo/:id',
            component: ModelLabelInfo,
            name: routerNames.modelLabelInfo,
            props: route => ({id: route.params.id})
          },
          {
            path: 'modelInfo/:id',
            component: ModelDefinitionInfo,
            name: routerNames.modelConfigInfo,
            props: route => ({id: route.params.id})
          },
          {
            path: 'modelLabelList/:id',
            component: ModelLabelTableData,
            name: routerNames.modelLabelChildren,
            props: route => ({id: route.params.id})
          },
          {
            path: 'modelDefinitionList/:id',
            component: ModelDefinitionTableData,
            name: routerNames.modelDefinitionChildren,
            props: route => ({id: route.params.id})
          },
          {
            path: 'modelAttrList/:id',
            component: ModelAttributeTableData,
            name: routerNames.modelAttrList,
            props: route => ({id: route.params.id})
          },
          {
            path: 'modelFormConfig/:id',
            component: ModelFormConfigTableData,
            name: routerNames.modelFormConfig,
            props: route => ({id: route.params.id})
          }
        ]
      }
    ]
  }
]

export default routerPath
